﻿
using System.Reflection;
using Snake.Core;

namespace Snake.Mapping
{
    /// <summary>
    /// 数据库字段：实体属性对应类
    /// </summary>
    public class PropertyMap
    {
        public PropertyInfo Property { get; private set; }
        public BracketedName Column { get; private set; }

        public PropertyMap(PropertyInfo propertyInfo, BracketedName column)
        {
            Property = propertyInfo;
            Column = column;
        }
    }
    /// <summary>
    /// 内部类引用的map
    /// </summary>
    public class ReferenceMap : PropertyMap
    {
        public EntityMap From { get; private set; }
        public EntityMap To { get; private set; }

        public ReferenceMap(PropertyInfo propertyInfo, BracketedName column, EntityMap from, EntityMap to)
            : base(propertyInfo, column)
        {
            From = from;
            To = to;
        }
    }

}